package org.currentcost.messages;

import java.util.Date;

public class CostData
{
	public static final double NORMAL_PRICE = 0.0916;
	public static final double LOW_PRICE = 0.0567;

	private final Date _date;
	public final EnviUnit unit;
	private double _lowCost;
	private double _normalCost;
	private double _lowValue;
	private double _normalValue;

	public CostData(Date date, EnviUnit unit)
	{
		_date = date;
		this.unit = unit;
	}

	public void addValue(boolean lowPrice, double value)
	{
		if (lowPrice) {
			_lowCost += LOW_PRICE * value;
			_lowValue += value;
		}
		else {
			_normalCost += NORMAL_PRICE * value;
			_normalValue += value;
		}
	}

	public double getLowCost()
	{
		return _lowCost;
	}

	public double getNormalCost()
	{
		return _normalCost;
	}

	public Date getDate()
	{
		return _date;
	}

	public double getLowValue()
	{
		return _lowValue;
	}

	public double getNormalValue()
	{
		return _normalValue;
	}
}
